<?php
function wpsc_print_download_file($product_id){
	global $wpdb;
	$product_id = absint( $product_id );
	$file_list = wpsc_uploaded_files();

	$args = array(
		'post_type' => 'wpsc-product-file',
		'post_parent' => $product_id,
		'numberposts' => -1,
		'post_status' => 'all'
	);

	$attached_files = (array)get_posts( $args );
	//print_r($attached_files);
	echo '<ul>';
	foreach($attached_files as $key=>$val){
		echo '<li>';
			echo '<a href='.$val->guid.'>';
				echo $val->post_title;
			echo '</a>';
		echo '</li>';
	}
	echo '</ul>';
}
function hh_wpsc_display_featured(){
	global $post;
    $sticky = get_option( 'sticky_products' );
    
    $args = array(
        'post_type' => 'wpsc-product',
        'posts_per_page' => -1,
        'post__in' => $sticky,
        'orderby' => 'date',
        'order' => 'DESC',
        'include' => '',
        'exclude' => '',
        'post_status' => 'publish',
    );
    
    query_posts(  $args  );
    
    ?>
    <ul class="products-list">
        <?php
            if ( have_posts() ) : setup_postdata($post);
                while ( have_posts() ) : the_post(); ?>
                    <li class="products-item">
                        <div class="product">
							<?php if(wpsc_the_product_thumbnail()) :?> 	   
									<img style="width:135px;height:130px" class="product_image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="<?php echo wpsc_the_product_title(); ?>" src="<?php echo wpsc_the_product_thumbnail(); ?>" />
							<?php else: ?> 
									<img class="no-image" id="product_image_<?php echo wpsc_the_product_id(); ?>" alt="No Image" title="<?php echo wpsc_the_product_title(); ?>" src="<?php echo WPSC_CORE_THEME_URL; ?>wpsc-images/noimage.png" width="135" height="130" />
							<?php endif; ?>
							<div class="product-caption small">
								<a href="<?php the_permalink() ?>" title="<?php printf(__('Permanent Link to %s','rys'), get_the_title()) ?>" rel="bookmark"><?php the_title(); ?></a>
							</div>
						</div>
                    </li><?php 
                endwhile;
            endif; wp_reset_query();
        ?> 
    </ul><?php
}
?>